//
// Created by xiaoma on 1/28/21.
//

#ifndef HORSE_VM_HISTRING_H
#define HORSE_VM_HISTRING_H

#include <iostream>

#include "HiObject.h"
#include "Universe.h"

class StringKlass : public Klass {
public:
    static StringKlass *getKlass() {
        static StringKlass klass;
        return &klass;
    }

    virtual void print(HiObject *object);

    virtual HiBool *equal(HiObject *lhs, HiObject *rhs);

private:
    StringKlass() {}
};

class HiString : public HiObject {
public:
    HiString(const char *str);

    HiString(const char *str, int length);

    const char *value() const { return _value; }

    int length() const { return _len; }

private:
    char *_value;
    int _len;
};

#endif //HORSE_VM_HISTRING_H
